package com.zlkj.manager.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zlkj.manager.mapper.PlCommunityMapper;
import com.zlkj.manager.domain.PlCommunity;
import com.zlkj.manager.service.IPlCommunityService;

/**
 * 社区Service业务层处理
 * 
 * @author liubo
 * @date 2022-03-04
 */
@Service
public class PlCommunityServiceImpl implements IPlCommunityService 
{
    @Autowired
    private PlCommunityMapper plCommunityMapper;

    /**
     * 查询社区
     * 
     * @param communityId 社区主键
     * @return 社区
     */
    @Override
    public PlCommunity selectPlCommunityByCommunityId(Long communityId)
    {
        return plCommunityMapper.selectPlCommunityByCommunityId(communityId);
    }

    /**
     * 查询社区列表
     * 
     * @param plCommunity 社区
     * @return 社区
     */
    @Override
    public List<PlCommunity> selectPlCommunityList(PlCommunity plCommunity)
    {
        return plCommunityMapper.selectPlCommunityList(plCommunity);
    }

    /**
     * 新增社区
     * 
     * @param plCommunity 社区
     * @return 结果
     */
    @Override
    public int insertPlCommunity(PlCommunity plCommunity)
    {
        plCommunity.setCreateTime(DateUtils.getNowDate());
        return plCommunityMapper.insertPlCommunity(plCommunity);
    }

    /**
     * 修改社区
     * 
     * @param plCommunity 社区
     * @return 结果
     */
    @Override
    public int updatePlCommunity(PlCommunity plCommunity)
    {
        plCommunity.setUpdateTime(DateUtils.getNowDate());
        return plCommunityMapper.updatePlCommunity(plCommunity);
    }

    /**
     * 批量删除社区
     * 
     * @param communityIds 需要删除的社区主键
     * @return 结果
     */
    @Override
    public int deletePlCommunityByCommunityIds(Long[] communityIds)
    {
        return plCommunityMapper.deletePlCommunityByCommunityIds(communityIds);
    }

    /**
     * 删除社区信息
     * 
     * @param communityId 社区主键
     * @return 结果
     */
    @Override
    public int deletePlCommunityByCommunityId(Long communityId)
    {
        return plCommunityMapper.deletePlCommunityByCommunityId(communityId);
    }
}
